<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    <!--{include file="comm/icheck.tpl"}-->
    <!--{include file='comm/comm_editor.tpl'}-->
    <title>修改下午茶库存</title>
</head>
<body>
<div class="container">

    <div class="comm_crub">
        <span class="now_crub">修改下午茶库存</span>
    </div>

    <div class="comm_content">

            <div  >
                <form id="searchForm" class="form-inline" onsubmit="return false;">
                    <div class="search-box" style="position:relative;background-color: whitesmoke;" >
                        <span>
                            <span style='width:120px;text-align:right'>库存编号：</span>
                            <input type="text" class="form-control input-sm" style="width:160px"  value="<!--{$stock_array[0].stock_id}-->" readonly="readonly"/>
                        </span></br>
                        <span>
                            <span style='width:120px;text-align:right'>配送日期：</span>
                            <input type="text" class="form-control input-sm" style="width:160px"  value="<!--{$stock_array[0].stock_date}-->" readonly="readonly"/>
                        </span></br>
                        <span>
                            <span style='width:120px;text-align:right'>配送站：</span>
                            <input type="text" class="form-control input-sm" style="width:160px"  value="<!--{$stock_array[0].distribution_name}-->" readonly="readonly"/>
                        </span></br>
                        <span>
                            <span style='width:120px;text-align:right'>商品名称：</span>
                            <input type="text" class="form-control input-sm" style="width:160px"  value="<!--{$stock_array[0].product_name}-->" readonly="readonly"/>
                        </span></br>
                         <span>
                           <span style='width:120px;text-align:right'><span class="red">*</span>修改类型：</span>
                            <select name="log_type" id="log_type" class="form-control input-sm" style="width:160px;">
                                <option value="">请选择</option>
                                <option value="1">入库</option>
                                <option value="2">异动</option>
                            </select>
                        </span></br>
                        <span>
                            <span style='width:120px;text-align:right'><span class="red">*</span>修改数量：</span>
                            <input type="text" class="form-control input-sm" id="amount" name="amount" maxlength="6"  style="width:160px" />
                            <span class="red">操作的是实际库存数量，可通过“+”、“-”号增减数量</span>
                        </span></br>
                        <span>
                            <span style='width:120px;text-align:right'>备注：</span>
                            <textarea class="form-control w300" id="remark" name="remark" placeholder="请输入备注"></textarea>
                        </span></br>
                    </div>
                </form>
                <div class="bottom_fixbox">
        			<div class="tac" style="background: #dddddd;">
           			<input type="button" class="btn btn-primary" onclick="coupon.add();" value="确定" />&nbsp;&nbsp;&nbsp;
            		<input type="button" class="btn btn-default" onclick="E.closeWindows();" value="关闭" />
        		</div>
            </div>
        </div>
            <input type="hidden" id="cityName"/>
            <input type="hidden" id="distribution_name"/>
        </div>

</div>

<script type="text/javascript">

    $('#apply_date').datepicker();

    var coupon = {
        choose_data: { },
        general_goods:{ },

        add : function(){

        		var log_type = $('#log_type').val();
        		var amount = $('#amount').val();
                var remark=$("#remark").val();

        		var msg ='';

				if(log_type==''){
					msg+="请选择修改类型<br />";
				}
                if(amount==''){
                    msg+="请填写修改数量<br />";
                }

        		if(msg !=''){
        			E.alert(msg);
        			return false;
        		}
                E.ajax_post({
		            url: "/invokingAjax-backend/production/stockSearch.ajax?operFlg=2",
		            data: {
                        stock_id : <!--{$stock_array[0].stock_id}--> ,
                        amount : amount,
                        log_type:log_type,
                        remark : remark
		            },
                    call: function(data){
						if(data.code=200){
							E.alert('库存修改成功',2);
                            E.opener('coupon.search');
                            E.closeWindows();
						}else{
                            E.alert(data.message);
                        }

		            }
		        });
        }
    };



</script>

</body>
</html>